﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MShop.Core.Domain
{

    [MetadataType(typeof(ProductImg_Validation))]
    public partial class ProductImg
    {
         

         

        public string ImageUrl
        {
            get
            {
                if (string.IsNullOrEmpty(this.Url))
                {
                    return string.Empty; ;
                }
                return "/uploads/" + Url;// this.Face.Split('/')[0] + "/thumb_" + this.Face.Split('/')[1];
            }
        }

        public string ThumbImageUrl
        {
            get
            {
                if (string.IsNullOrEmpty(this.Url))
                {
                    return Url;
                }
                try
                {
                    return "/uploads/" + this.Url.Split('/')[0] + "/thumb_" + this.Url.Split('/')[1];
                }
                catch
                {
                    return string.Empty;
                }
            }
        }
    }

    internal partial class ProductImg_Validation
    { 
       
    }
}